<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: Logger</title>
    
    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">
    
    <h1 class="page-title">Class: Logger</h1>
    
    



<section>
    
<header>
    <h2>
        <span class="ancestors"><a href="easynode.html">easynode</a>.</span>
    
    Logger
    </h2>
    
</header>  

<article>
    <div class="container-overview">
    
    
    
        
<dt>
    <h4 class="name" id="Logger"><span class="type-signature"></span>new Logger<span class="signature">()</span><span class="type-signature"></span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Logger of EasyNode. This is a singleton class. DO NOT create any instance of Logger, use getInstance() instead.
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    
    <dt class="tag-since">Since:</dt>
    <dd class="tag-since"><ul class="dummy"><li>1.0</dd>
    

    
    
    
    
    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>zlbbq</li>
        </ul>
    </dd>
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Logger.js.html">easynode/Logger.js</a>, <a href="Logger.js.html#line21">line 21</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>using('easynode.Logger');
var logger = easynode.Logger.getLogger('loggerName');
logger.debug('hello');

var logger = easynode.Logger.forFile(__filename);
logger.debug('hello');</code></pre>

    
</dd>

    
    </div>
    
    
    
    
    
    
    
    
    
    
    
    
    
    
        <h3 class="subsection-title">Methods</h3>
        
        <dl>
            
<dt>
    <h4 class="name" id="forFile"><span class="type-signature">&lt;static> </span>forFile<span class="signature">(fileName)</span><span class="type-signature"> &rarr; {Object}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get Logger for a file
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>fileName</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">File name, pass __dirname or __filename</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    
    <dt class="tag-since">Since:</dt>
    <dd class="tag-since"><ul class="dummy"><li>1.0</dd>
    

    
    
    
    
    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>zlbbq</li>
        </ul>
    </dd>
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Logger.js.html">easynode/Logger.js</a>, <a href="Logger.js.html#line116">line 116</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Logger instance. A logger instance has debug, info, warn, error, fatal methods mapping 5 log levels DEBUG, INFO, WARN, ERROR, FATAL
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>using('easynode.Logger');
var logger = easynode.Logger.getLogger.getInstance();
logger.getLogger().debug('hello');
logger.getLogger('loggerName').debug('hello');</code></pre>

    
</dd>

        
            
<dt>
    <h4 class="name" id="getInstance"><span class="type-signature">&lt;static> </span>getInstance<span class="signature">()</span><span class="type-signature"> &rarr; {<a href="easynode.Logger.html">easynode.Logger</a>}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get the singleton instance of Logger
    </div>
    

    
    
    
    
    
    
    
<dl class="details">
    
        
    
    
    
    <dt class="tag-since">Since:</dt>
    <dd class="tag-since"><ul class="dummy"><li>1.0</dd>
    

    
    
    
    
    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>zlbbq</li>
        </ul>
    </dd>
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Logger.js.html">easynode/Logger.js</a>, <a href="Logger.js.html#line74">line 74</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Logger instance
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type"><a href="easynode.Logger.html">easynode.Logger</a></span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>using('easynode.Logger');
var logger = easynode.Logger.getLogger.getInstance();
logger.getLogger().debug('hello');
logger.getLogger().info('hello');
logger.getLogger().warn('hello');
logger.getLogger().error('hello');
logger.getLogger().fatal('hello');</code></pre>

    
</dd>

        
            
<dt>
    <h4 class="name" id="getLogger"><span class="type-signature">&lt;static> </span>getLogger<span class="signature">(name)</span><span class="type-signature"> &rarr; {Object}</span></h4>
    
    
</dt>
<dd>
    
    
    <div class="description">
        Get the singleton instance of Logger
    </div>
    

    
    
    
    
    
        <h5>Parameters:</h5>
        

<table class="params">
    <thead>
	<tr>
		
		<th>Name</th>
		
		
		<th>Type</th>
		
		
		
		
		
		<th class="last">Description</th>
	</tr>
	</thead>
	
	<tbody>
	
	
        <tr>
            
                <td class="name"><code>name</code></td>
            
            
            <td class="type">
            
                
<span class="param-type">String</span>


            
            </td>
            
            
            
            
            
            <td class="description last">Logger name, default value is 'root'</td>
        </tr>
	
	
	</tbody>
</table>
    
    
    
<dl class="details">
    
        
    
    
    
    <dt class="tag-since">Since:</dt>
    <dd class="tag-since"><ul class="dummy"><li>1.0</dd>
    

    
    
    
    
    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>zlbbq</li>
        </ul>
    </dd>
    
    
    
    
    
    
    
    
    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="Logger.js.html">easynode/Logger.js</a>, <a href="Logger.js.html#line96">line 96</a>
    </li></ul></dd>
    
    
    
    
    
    
    
</dl>

    
    

    

    
    
    
    
    
    <h5>Returns:</h5>
    
            
<div class="param-desc">
    Logger instance. A logger instance has debug, info, warn, error, fatal methods mapping 5 log levels DEBUG, INFO, WARN, ERROR, FATAL
</div>



<dl>
	<dt>
		Type
	</dt>
	<dd>
		
<span class="param-type">Object</span>


	</dd>
</dl>

        
    
    
        <h5>Example</h5>
        
    <pre class="prettyprint"><code>using('easynode.Logger');
var logger = easynode.Logger.getLogger.getInstance();
logger.getLogger().debug('hello');
logger.getLogger('loggerName').debug('hello');</code></pre>

    
</dd>

        </dl>
    
    
    
    
    
</article>

</section>  




</div>

<nav>
    <h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="easynode.Logger.html">Logger</a></li></ul><h3>Namespaces</h3><ul><li><a href="easynode.html">easynode</a></li><li><a href="easynode.framework.html">framework</a></li><li><a href="easynode.framework.server.html">server</a></li><li><a href="easynode.test.html">test</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addSourceFolder">addSourceFolder</a></li><li><a href="global.html#arg">arg</a></li><li><a href="global.html#config">config</a></li><li><a href="global.html#extend">extend</a></li><li><a href="global.html#home">home</a></li><li><a href="global.html#namespace">namespace</a></li><li><a href="global.html#real">real</a></li><li><a href="global.html#resolveNamespaces">resolveNamespaces</a></li><li><a href="global.html#trim">trim</a></li><li><a href="global.html#using">using</a></li></ul>
</nav>

<br clear="both">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.2</a> on Sat May 09 2015 09:08:52 GMT+0800 (CST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>